﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.IO;

namespace InputOutput
{
    class Sha1
    {

        static void Main()
        {
            SHA1 codded = SHA1.Create();
            FileStream inFile = new FileStream("Memory-Management.bin", FileMode.Open);
            using (inFile) 
            {
                using (FileStream outFile = new FileStream("SHA-1.out", FileMode.OpenOrCreate)) 
                {
                    byte [] fileData = new byte[inFile.Length];
                    inFile.Read(fileData, 0, fileData.Length);
                    byte[] coded = codded.ComputeHash(inFile);
                    outFile.Write(coded,0,coded.Length);
                }
            }
        }
    }
}
